import { uploadBaseProps } from "element-plus";
import service from ".";

const carsApi={
    //发送axios请求
//添加
insert(cars){
      //发送axios请求
   return service.post('admin/cars', cars);
},
//删除
delete(cid) {
    return service.delete(`admin/cars/${cid}`);
},
//修改
update(cars){
    //发送axios请求
 return service.put('admin/cars',cars);
},
//查询所有
selectByCplate(pageNum,cplate,cstate){
    //发送axios请求
 return service.get('admin/cars',{
    params:{
      pageNum,
     cplate,
     cstate
    }

 });
},
//根据id进行查询
selectByCid(cid) {
    return service.get(`admin/cars/${cid}`);
},
//导出
download(){
    return service.get("admin/cars/download",{responseType: 'blob'});

}

};

export default carsApi;